import request from '@/utils/request'

// 查询版本3 --- 账单主列表
export function listBill(query) {
  return request({
    url: '/sale/bill/list',
    method: 'get',
    params: query
  })
}

export function listBillData(query) {
  return request({
    url: '/sale/bill/listData',
    method: 'get',
    params: query
  })
}

// 查询版本3 --- 账单主详细
export function getBill(id) {
  return request({
    url: '/sale/bill/' + id,
    method: 'get'
  })
}

// 新增版本3 --- 账单主
export function addBill(data) {
  return request({
    url: '/sale/bill',
    method: 'post',
    data: data
  })
}

// 作废
export function updateBillNoPass(id, remark) {
  return request({
    url: '/sale/bill/noPass',
    method: 'put',
    params: {id: id, remark: remark}
  })
}

export function updateBillPass(id,remark) {
  return request({
    url: '/sale/bill/pass',
    method: 'put',
    params: {id: id, remark: remark}
  })
}

// 导出版本3 --- 账单主
export function exportBill(query) {
  return request({
    url: '/sale/bill/export',
    method: 'get',
    params: query
  })
}
